	<div class="pageContent" style="border-left:1px #B8D0D6 solid;border-right:1px #B8D0D6 solid">
		<div class="panelBar">
			<ul class="toolBar">
				<li><a class="icon" href="#" onclick="javascript:exports(this);" ><span>导出EXCEL</span></a></li>
			</ul>
		</div>

		<table class="list"  id="table_<?php echo $page_id=rand();?>" rel="jbsxBox" style="width: 100%;" layoutH="200%">
			<thead>
			<tr>
				<th>时间</th>
				<th>渠道</th>
				<th>版本</th>
				<th>展示</th>
				<th>展示用户</th>
				<th>点击</th>
				<th>点击用户</th>
				<th>安装</th>
				<th>安装用户</th>
				<th>点击率</th>
				<th>转化</th>
				<th>转化用户</th>
				<th>转化率</th>
				<th>总收益</th>
			</tr>
			</thead>
				<php>
					$date="";
					if( count($list) ):
						$data = [];
				</php>
					<tbody>
					<volist id="event" name="list">
						<tr>
							<php>$date=$key;</php>
							<td>{$date}</td>
							<td colspan="13"></td>
						</tr>
						<php>$data = [];$channel="";</php>
						<volist id="val" name="event">
							<tr>
								<php>$channel=$key;</php>
								<td></td>
								<td>{$channel}</td>
								<td colspan="12"></td>
							</tr>
							<volist id="val2" name="val">
								<php>
									$show     = intval($val2['show']);
									$show_u   = intval($val2['show_user']);
									$click    = intval($val2['click']);
									$click_u  = intval($val2['click_user']);
									$install  = intval($val2['installed']);
									$install_u  = intval($val2['installed_user']);
									$postback   = intval($val2['conversion']);
									$postback_u = intval($val2['conversion_user']);
									$income = number_format($val2['income'],2);

									$data[$channel]["show"][] = $show;
									$data[$date]["show"][] = $show;
									$data[$channel]["click"][] = $click;
									$data[$date]["click"][] = $click;
									$data[$channel]["postback"][] = $postback;
									$data[$date]["postback"][] = $postback;
									$data[$channel]["in"][] = $income;
									$data[$date]["in"][] = $income;
								</php>
								<tr>
									<td colspan="2"></td>
									<td>{$key}</td>
									<td>{$show}</td>
									<td>{$show_u}</td>
									<td>{$click}</td>
									<td>{$click_u}</td>
									<td>{$install}</td>
									<td>{$install_u}</td>
									<td><?php echo $show*$click ? round($click/$show, 4) * 100 : 0; ?> %</td>
									<td>{$postback}</td>
									<td>{$postback_u}</td>
									<td><?php echo $postback*$click ? round($postback/$click, 4) * 100 : 0; ?> %</td>
									<td>{$income}</td>
								</tr>
							</volist>
							<tr>
								<td colspan="2"></td>
								<td>渠道合计</td>
								<td>{$data[$channel]["show"]|array_sum}</td>
								<td></td>
								<td>{$data[$channel]["click"]|array_sum}</td>
								<td></td>
								<td></td>
								<td></td>
								<td></td>
								<td>{$data[$channel]["postback"]|array_sum}</td>
								<td></td>
								<td></td>
								<td>{$data[$channel]["in"]|array_sum}</td>
							</tr>
						</volist>
						<tr>
							<td colspan="1"></td>
							<td>日期合计</td>
							<td>-</td>
							<td>{$data[$date]["show"]|array_sum}</td>
							<td></td>
							<td>{$data[$date]["click"]|array_sum}</td>
							<td></td>
							<td></td>
							<td></td>
							<td></td>
							<td>{$data[$date]["postback"]|array_sum}</td>
							<td></td>
							<td></td>
							<td>{$data[$date]["in"]|array_sum}</td>
						</tr>
					</volist>
					<tr><td colspan="14">done</td></tr>
					</tbody>
			<php>endif;</php>
		</table>
	</div>

	<script>
        $('#table_<?php echo $page_id;?>').dataTable({
            "info": false,
            "paging": false,
            "searching": false,
        });
	</script>